import 'package:high_help_apps/common/entities/misc/schools/schools_response_entity.dart';

schoolsResponseEntityFromJson(SchoolsResponseEntity data, Map<String, dynamic> json) {
	if (json['success'] != null) {
		data.success = json['success'];
	}
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['message'] != null) {
		data.message = json['message'].toString();
	}
	if (json['detail'] != null) {
		data.detail = (json['detail'] as List).map((v) => SchoolsResponseDetail().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> schoolsResponseEntityToJson(SchoolsResponseEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['success'] = entity.success;
	data['code'] = entity.code;
	data['message'] = entity.message;
	data['detail'] =  entity.detail.map((v) => v.toJson()).toList();
	return data;
}

schoolsResponseDetailFromJson(SchoolsResponseDetail data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	return data;
}

Map<String, dynamic> schoolsResponseDetailToJson(SchoolsResponseDetail entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['name'] = entity.name;
	return data;
}